% Intrinsic and Extrinsic Camera Parameters
%
% This script file can be directly excecuted under Matlab to recover the camera intrinsic and extrinsic parameters.
% IMPORTANT: This file contains neither the structure of the calibration objects nor the image coordinates of the calibration points.
%            All those complementary variables are saved in the complete matlab data file Calib_Results.mat.
% For more information regarding the calibration model visit http://www.vision.caltech.edu/bouguetj/calib_doc/


%-- Focal length:
fc = [ 527.729120241730020 ; 528.790756714171610 ];

%-- Principal point:
cc = [ 333.165567074162940 ; 266.307672540717020 ];

%-- Skew coefficient:
alpha_c = 0.000000000000000;

%-- Distortion coefficients:
kc = [ 0.154252813149245 ; -0.290193453195104 ; 0.000171160562468 ; 0.004004194850056 ; 0.000000000000000 ];

%-- Focal length uncertainty:
fc_error = [ 8.226869810109376 ; 8.528043668360217 ];

%-- Principal point uncertainty:
cc_error = [ 8.652414127312849 ; 9.390551094663138 ];

%-- Skew coefficient uncertainty:
alpha_c_error = 0.000000000000000;

%-- Distortion coefficients uncertainty:
kc_error = [ 0.042114287438376 ; 0.146575127261954 ; 0.006695513605279 ; 0.006487952828012 ; 0.000000000000000 ];

%-- Image size:
nx = 640;
ny = 480;


%-- Various other variables (may be ignored if you do not use the Matlab Calibration Toolbox):
%-- Those variables are used to control which intrinsic parameters should be optimized

n_ima = 20;						% Number of calibration images
est_fc = [ 1 ; 1 ];					% Estimation indicator of the two focal variables
est_aspect_ratio = 1;				% Estimation indicator of the aspect ratio fc(2)/fc(1)
center_optim = 1;					% Estimation indicator of the principal point
est_alpha = 0;						% Estimation indicator of the skew coefficient
est_dist = [ 1 ; 1 ; 1 ; 1 ; 0 ];	% Estimation indicator of the distortion coefficients


%-- Extrinsic parameters:
%-- The rotation (omc_kk) and the translation (Tc_kk) vectors for every calibration image and their uncertainties

%-- Image #1:
omc_1 = [ 1.857240e+00 ; 2.422030e+00 ; -2.502960e-01 ];
Tc_1  = [ 2.075909e+01 ; -1.474967e+02 ; 5.881669e+02 ];
omc_error_1 = [ 1.674288e-02 ; 2.272408e-02 ; 4.025550e-02 ];
Tc_error_1  = [ 9.794601e+00 ; 1.033087e+01 ; 1.016668e+01 ];

%-- Image #2:
omc_2 = [ 1.855764e+00 ; 2.400206e+00 ; -2.751548e-01 ];
Tc_2  = [ -7.179327e+00 ; -4.911693e+01 ; 5.708385e+02 ];
omc_error_2 = [ 2.322582e-02 ; 2.668669e-02 ; 5.181756e-02 ];
Tc_error_2  = [ 9.333041e+00 ; 1.005747e+01 ; 1.001563e+01 ];

%-- Image #3:
omc_3 = [ 1.842662e+00 ; 2.416409e+00 ; -2.588009e-01 ];
Tc_3  = [ -2.899252e+01 ; 2.172946e+01 ; 5.568987e+02 ];
omc_error_3 = [ 3.258384e-02 ; 3.390328e-02 ; 6.508370e-02 ];
Tc_error_3  = [ 9.099504e+00 ; 9.969861e+00 ; 1.018303e+01 ];

%-- Image #4:
omc_4 = [ 1.757669e+00 ; 2.441174e+00 ; -2.513844e-01 ];
Tc_4  = [ -1.118982e+02 ; -2.039327e+02 ; 5.988441e+02 ];
omc_error_4 = [ 1.133119e-02 ; 2.216802e-02 ; 3.815191e-02 ];
Tc_error_4  = [ 1.004783e+01 ; 1.069252e+01 ; 1.056260e+01 ];

%-- Image #5:
omc_5 = [ 1.875193e+00 ; 2.352562e+00 ; -2.089025e-01 ];
Tc_5  = [ -1.436334e+02 ; -1.214548e+02 ; 5.826897e+02 ];
omc_error_5 = [ 1.527430e-02 ; 2.452918e-02 ; 4.260182e-02 ];
Tc_error_5  = [ 9.625200e+00 ; 1.039577e+01 ; 1.003301e+01 ];

%-- Image #6:
omc_6 = [ 1.962874e+00 ; 2.264265e+00 ; -2.173085e-01 ];
Tc_6  = [ -1.689253e+02 ; 5.634839e+00 ; 5.595966e+02 ];
omc_error_6 = [ 2.363969e-02 ; 2.911667e-02 ; 5.145749e-02 ];
Tc_error_6  = [ 9.165005e+00 ; 1.018566e+01 ; 9.862999e+00 ];

%-- Image #7:
omc_7 = [ -2.163394e+00 ; -1.912414e+00 ; -5.737815e-04 ];
Tc_7  = [ -7.534356e+01 ; -1.083174e+02 ; 3.782600e+02 ];
omc_error_7 = [ 1.762297e-02 ; 1.367504e-02 ; 3.201757e-02 ];
Tc_error_7  = [ 6.255200e+00 ; 6.717167e+00 ; 6.606309e+00 ];

%-- Image #8:
omc_8 = [ -1.545596e+00 ; -2.190723e+00 ; -3.285434e-01 ];
Tc_8  = [ -6.478576e+00 ; -1.730924e+02 ; 4.482106e+02 ];
omc_error_8 = [ 1.554445e-02 ; 2.251898e-02 ; 3.434885e-02 ];
Tc_error_8  = [ 7.581426e+00 ; 7.968097e+00 ; 8.703850e+00 ];

%-- Image #9:
omc_9 = [ 2.212494e+00 ; 1.597841e+00 ; -1.123338e+00 ];
Tc_9  = [ -1.095407e+01 ; -4.845065e+01 ; 4.605791e+02 ];
omc_error_9 = [ 1.343240e-02 ; 1.681354e-02 ; 2.409109e-02 ];
Tc_error_9  = [ 7.566200e+00 ; 8.081975e+00 ; 6.385108e+00 ];

%-- Image #10:
omc_10 = [ 1.688942e+00 ; 1.991079e+00 ; -3.517732e-01 ];
Tc_10  = [ -1.437525e+02 ; -1.192635e+02 ; 4.183864e+02 ];
omc_error_10 = [ 9.625738e-03 ; 1.727600e-02 ; 2.548069e-02 ];
Tc_error_10  = [ 6.994609e+00 ; 7.542997e+00 ; 7.356654e+00 ];

%-- Image #11:
omc_11 = [ 1.581161e+00 ; 2.023490e+00 ; -6.346812e-03 ];
Tc_11  = [ -1.564476e+02 ; -1.430667e+02 ; 4.157842e+02 ];
omc_error_11 = [ 1.112637e-02 ; 1.848396e-02 ; 2.680848e-02 ];
Tc_error_11  = [ 7.017420e+00 ; 7.551353e+00 ; 7.912490e+00 ];

%-- Image #12:
omc_12 = [ 1.847288e+00 ; 2.069508e+00 ; -3.342668e-01 ];
Tc_12  = [ -5.488307e+01 ; -1.283404e+02 ; 4.507881e+02 ];
omc_error_12 = [ 1.188916e-02 ; 1.588964e-02 ; 2.655360e-02 ];
Tc_error_12  = [ 7.463411e+00 ; 7.907602e+00 ; 7.431408e+00 ];

%-- Image #13:
omc_13 = [ -2.246279e+00 ; -1.921374e+00 ; 1.512310e-01 ];
Tc_13  = [ -1.862237e+01 ; -1.665577e+02 ; 4.370741e+02 ];
omc_error_13 = [ 2.551275e-02 ; 1.898997e-02 ; 3.921848e-02 ];
Tc_error_13  = [ 7.414183e+00 ; 7.723976e+00 ; 7.862194e+00 ];

%-- Image #14:
omc_14 = [ -2.233223e+00 ; -2.118108e+00 ; 4.053530e-02 ];
Tc_14  = [ -7.826524e+01 ; -1.471190e+02 ; 4.909069e+02 ];
omc_error_14 = [ 2.497345e-02 ; 1.984505e-02 ; 4.970507e-02 ];
Tc_error_14  = [ 8.157814e+00 ; 8.723977e+00 ; 8.683619e+00 ];

%-- Image #15:
omc_15 = [ 1.809410e+00 ; 1.827649e+00 ; -8.761388e-01 ];
Tc_15  = [ -4.130381e+01 ; -6.058946e+01 ; 4.909449e+02 ];
omc_error_15 = [ 1.183948e-02 ; 1.707122e-02 ; 2.322831e-02 ];
Tc_error_15  = [ 8.033761e+00 ; 8.649213e+00 ; 7.092005e+00 ];

%-- Image #16:
omc_16 = [ 2.374839e+00 ; 1.354807e+00 ; -1.293321e+00 ];
Tc_16  = [ -2.083036e+01 ; -7.354013e+01 ; 4.356972e+02 ];
omc_error_16 = [ 1.453845e-02 ; 1.764682e-02 ; 2.324715e-02 ];
Tc_error_16  = [ 7.199552e+00 ; 7.667082e+00 ; 5.810664e+00 ];

%-- Image #17:
omc_17 = [ -1.555598e+00 ; -1.526695e+00 ; -8.831612e-01 ];
Tc_17  = [ -6.972867e+01 ; -1.095663e+02 ; 3.516483e+02 ];
omc_error_17 = [ 1.464010e-02 ; 1.731240e-02 ; 1.997885e-02 ];
Tc_error_17  = [ 5.873369e+00 ; 6.272176e+00 ; 6.994791e+00 ];

%-- Image #18:
omc_18 = [ 2.091865e+00 ; 2.227575e+00 ; -2.047451e-01 ];
Tc_18  = [ -7.879783e+01 ; -8.667640e+01 ; 2.688457e+02 ];
omc_error_18 = [ 9.811700e-03 ; 1.297260e-02 ; 2.466674e-02 ];
Tc_error_18  = [ 4.433269e+00 ; 4.749748e+00 ; 4.838145e+00 ];

%-- Image #19:
omc_19 = [ 2.118940e+00 ; 2.308428e+00 ; -1.820484e-01 ];
Tc_19  = [ -8.543789e+01 ; -1.222832e+02 ; 4.343856e+02 ];
omc_error_19 = [ 1.409214e-02 ; 1.865322e-02 ; 3.693221e-02 ];
Tc_error_19  = [ 7.176381e+00 ; 7.695479e+00 ; 7.524230e+00 ];

%-- Image #20:
omc_20 = [ 2.096015e+00 ; 2.262768e+00 ; -1.826053e-01 ];
Tc_20  = [ -9.030224e+01 ; -9.148954e+01 ; 4.779764e+02 ];
omc_error_20 = [ 1.729655e-02 ; 2.099770e-02 ; 4.135083e-02 ];
Tc_error_20  = [ 7.834177e+00 ; 8.459478e+00 ; 8.134331e+00 ];

